package com.project.bean;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.time.LocalDate;
import java.util.List;

/***
 * 主贴实体类
 */
public class  MainStickerBean {
    /**编号*/
     private int id;
     /**标题*/
     private String title;
     /**作者*/
     private String author;
     /**回帖数量*/
     private int postNumber;
     /**发帖时间*/
     @JsonFormat(pattern = "yyyy-MM-gg")
     private LocalDate postDate = LocalDate.now();
     /**主贴内容*/
     private String content;
     /**主贴所属频道对象*/
     private ChannelBean channel;

    public MainStickerBean() {
    }

    public MainStickerBean(String title, String author, String content, int channelId) {
        this.title = title;
        this.author = author;
        this.content = content;
        this.channel = new ChannelBean();
        this.channel.setId(channelId);
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public int getPostNumber() {
        return postNumber;
    }

    public void setPostNumber(int postNumber) {
        this.postNumber = postNumber;
    }

    public LocalDate getPostDate() {
        return postDate;
    }

    public void setPostDate(LocalDate postDate) {
        this.postDate = postDate;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public ChannelBean getChannel() {
        return channel;
    }

    public void setChannel(ChannelBean channel) {
        this.channel = channel;
    }

    @Override
    public String toString() {
        return "MainStickerBean{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", author='" + author + '\'' +
                ", postNumber=" + postNumber +
                ", postDate=" + postDate +
                ", content='" + content + '\'' +
                ", channel=" + channel +
                "}\n";
    }
}
